<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<!--#include file="page.asp"-->
<!--#include file="sqlerr.asp" -->
<script language="javascript">
function showUploadDialog(s_Type, s_Link, s_Thumbnail){
var arr = showModalDialog("eWebEditor/dialog/i_upload.htm?style=popup&type="+s_Type+"&link="+s_Link+"&thumbnail="+s_Thumbnail, window, "dialogWidth:0px;dialogHeight:0px;help:no;scroll:no;status:no");}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="images/style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="head"><strong>首页静态广告管理</strong></td>
</tr>
<tr>
<td>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="head_chile">
<tr>
<td width="27%">广告标题</td>
<td>广告图片路径</td>
<td width="25%">广告超链接</td>
<td width="10%" align="center">修改</td>
</tr>
</table>
<%	
set rs=server.createobject("adodb.recordset") 
exec="select * from AD2 order by id asc" 
rs.open exec,conn,1,1 
if rs.eof then
response.Write "&nbsp;暂无视频！"
else
rs.PageSize =20 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif  page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if	
%>
<%For i=1 To x%>
<form  name="form<%=i%>" method="post" action="Manage_AD2.asp?type=update">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="27%" height="30">
        <input name="Title" type="text" class="textbox" id="Title" value="<%=rs("Title")%>" size="30">
        <input name="id" type="hidden" id="id" value="<%=rs("id")%>" />    </td>
    <td>
        <input name="pic_url" type="text" class="textbox" id="pic_url" value="<%=rs("pic_url")%>" size="40" />
        <input type="button" value="上传" onclick="showUploadDialog('image', 'form<%=i%>.pic_url', '')" />    </td>
    <td width="25%"><input name="link_url" type="text" class="textbox" id="link_url" value="<%=rs("link_url")%>" size="30" /></td>
    <td width="10%" align="center"><a href="javascript:this.form<%=i%>.submit();">修改</a></td>
    </tr>
    </table>
</form>
<%rs.movenext
next
%>
<%end if%></td>
</tr>
</table>
<br>
</body>
</html>


<% 
if Request.QueryString("type")="update" then
	id=request("id") 
	Title=request.form("Title")
	pic_url=request.form("pic_url")
	link_url=request.form("link_url")
	sql="select * from AD2 where id="&id 
	set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3
	if not rs.eof then
		rs("Title")=Title
		rs("pic_url")=pic_url
		rs("link_url")=link_url
	end if
	rs.update 
	rs.close
	set rs=nothing
	response.Write("<script language=""javascript"">alert(""修改视频成功！"");window.location.href='Manage_AD2.asp';</script>")
end if
%> 

